package mall.controller;

import com.mall.pojo.goods.Sku;
//import com.mall.service.business.AdService;
import com.mall.service.goods.CategoryService;
import com.mall.service.goods.SkuService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/item")
public class ItemController {

//    @DubboReference
//    private AdService adService;

    @DubboReference
    private SkuService skuService;


    @DubboReference
    private CategoryService categoryService;

    @GetMapping("/price")
    public int getPriceBuSkuId(String id){
        Sku sku = skuService.findById(id);
        return sku.getPrice();
    }

}
